package com.hsogoo.collate.service;

import com.hsogoo.collate.domain.DynamicQuery;
import com.hsogoo.collate.mapper.DynamicMapper;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

/**
 * @Author huangsaigang
 * Created @2019-11-06.
 */
public class DynamicQueryTask implements Callable<List<Map<String, Object>>> {

    private DynamicMapper dynamicMapper;
    private DynamicQuery dynamicQuery;

    public DynamicQueryTask(DynamicMapper dynamicMapper, DynamicQuery dynamicQuery){
        this.dynamicMapper = dynamicMapper;
        this.dynamicQuery = dynamicQuery;
    }

    @Override
    public List<Map<String, Object>> call() throws Exception {
        return dynamicMapper.queryData(dynamicQuery);
    }
}
